<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container">
    <div class="show-house-name row">
        <div id="showOther">
            <div class="col-md-12" th:each="oneOrder : ${session.orderpage.getList()}">
                <img style="height: 100px;width: 100px;border-radius: 50px;" class="img-thumbnail"
                     th:src="'../user/'+${session.orderuser.userimage}">
                <br>
                <hr>
                <p><span class="field">用户名：</span><span class="name" th:text="${session.orderuser.username}"></span></p>
                <p><span class="field">性别：</span><span class="name" th:text="${session.orderuser.usergender}"></span>
                </p>
                <p><span class="field">职业：</span><span class="name" th:text="${session.orderuser.userjob}"></span></p>
                <p><span class="field">信用分数：</span><span class="name" th:text="${session.orderuser.usergrade}"></span>
                </p>
                <p><span class="field">发布日期：</span><span class="name" th:text="${oneOrder.orderdate}"></span></p>
                <p><span class="field">发布描述：</span><span class="name" th:text="${oneOrder.orderdescription}"></span></p>
            </div>
            <hr>
            <nav aria-label="Page navigation example">
                <ul class="pagination btn-lg">
                    <li class="page-item">
                        <a class="page-link" href="#" aria-label="Previous"
                           th:class="!${session.orderpage.hasPreviousPage}? 'page-link btn disabled':'page-link' "
                           th:onclick="loadNewPageForOrder('/order/getHouseOrder',[[${session.orderpage.prePage}]])">
                            <span aria-hidden="true">Previous</span>
                        </a>
                    </li>
                    <li class="page-item" th:each="i : ${session.orderpage.navigatepageNums}">
                        <a th:class="${i}==${session.orderpage.pageNum}?'active page-link':'page-link'"
                           th:onclick="loadNewPageForOrder('/order/getHouseOrder',[[${i}]])">[[${i}]]</a>
                    </li>
                    <li class="page-item">
                        <a class="page-link" href="#" aria-label="Next"
                           th:class="!${session.orderpage.hasNextPage}? 'page-link btn disabled':'page-link' "
                           th:onclick="loadNewPageForOrder('/order/getHouseOrder', [[${session.orderpage.nextPage}]])">
                            <span aria-hidden="true">Next</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
    <!--<div class="row">-->
    <!--    <div class="col-md-12">-->

    <!--    </div>-->
    <!--</div>-->
</div>
</body>
<script>
    function loadNewPageForOrder(url, a) {
        $.ajax({
            url: url,
            type: 'GET',
            data: {"pageNo": a},
            success: function (data) {
                $('#showOther').html(data);
            },
            error: function () {
                alert("请求错误！！");
            }
        })
    }
</script>
</html>